package com.hfzy.ihk.web.userCenter.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfzy.ihk.facade.userCenter.entity.RoleHasPriv;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wws
 * @since 2018-12-28
 */
public interface RoleHasPrivMapper extends BaseMapper<RoleHasPriv> {



    @Delete("delete from role_has_priv where role_Id = #{roleId}")
    int deleteRoleHasPriv(Long roleId);



    @Select("select v.priv_name from role_has_priv rh left join priv v on v.id=rh.priv_id where rh.role_id = #{roleId}")
    List<String> getRoleHasPrivByRoleId(Long roleId);



}
